import axios from '@/api/fetch';
import SERVER from '@/api/server';

export const getListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/getListByPage`, params);
//通过考核单号取得索赔单和结算单信息
export const SelectAssesBySettleIds = (id, params) => axios.get(`${SERVER.CLAIMDEALER}/rPAssess/selectBySettleIds/${id}`, { params });
export const SelectClaimBySettleIds = (id, params) => axios.get(`${SERVER.CLAIMDEALER}/rPCmsClaim/selectBySettleIds/${id}`, { params });
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/saveOne`,  params );
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/updateStatusById/${id}`,{params} );
//修改回显
export const quyrpBatch = (id, params) => axios.get(`${SERVER.CLAIMDEALER}/rpBatch/selectById/${id}`, { params });

export const getPartType = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getBaseDataByType`, { params });
//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/updateByPtId`,  params );

//提交
export const submitById = params => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/updateStatus`,  params );


//添加发票最大金额和税率获取
//获取配件
// export const getInvoiceInfo = params =>
//   axios.get(`${SERVER.CLAIMFAC}/const/getInvoiceInfo`, {
//     params
//   });
export const getInvoiceInfo = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getInvoiceInfo`, {params});
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMDEALER}/rpBatch/getInvoiceListForExport`, params, {
  responseType: 'blob'
});
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);